<template>
	<view class="content mainpadding" v-if="pageShow">
		<!-- <view class="flexleft paddinglr15" @click="show=true"> -->
		<view class="flexbetween paddinglr15">
			<view class="flexleft ">
				<view class="text_j color_san margin_right2" v-if="orderInfo.status==100">待確定</view>
				<view class="text_j color_san margin_right2" v-if="orderInfo.status==0">等待支付</view>
				<view class="text_j color_san margin_right2" v-if="orderInfo.status==1">等待接單</view>
				<view class="text_j color_san margin_right2" v-if="orderInfo.status==2">等待制作</view>
				<view class="text_j color_san margin_right2" v-if="orderInfo.status==5">等待取貨</view>
				<view class="text_j color_san margin_right2" v-if="orderInfo.status==6">配送中待接單</view>
				<view class="text_j color_san margin_right2" v-if="orderInfo.status==7">配送中待取貨</view>
				<view class="text_j color_san margin_right2" v-if="orderInfo.status==8">配送中</view>
				<view class="text_j color_san margin_right2" v-if="orderInfo.status==9">已送達</view>
				<view class="text_j color_san margin_right2" v-if="orderInfo.status==87">待完成</view>
				<view class="text_j color_san margin_right2" v-if="orderInfo.status==88">已完成</view>
				<view class="text_j color_san margin_right2" v-if="orderInfo.status==99">已取消</view>
				<u-icon name="arrow-right" color="#999" size="16"></u-icon>
			</view>
			<view class="flexright">
				<view class="contactShop" @click="phone(orderInfo.shop_data.shopmbl)">打電話</view>
				<view class="listbtnhuang margin_left2" @click="connection">聊聊</view>
			</view>
		</view>
		
		<!-- 地址 -->
		<view class="margin_top border ffffff mainpadding" v-if="orderInfo.type==0">
			<view class="flexleft">
				<view class="text_w color_san margin_right3">{{orderInfo.username}}</view>
				<view class="text_w color_san">{{orderInfo.mobile}}</view>
			</view>
			<view class="text_five color_six margin_top">{{orderInfo.useraddre}}</view>
		</view>

		<!-- 商品 -->
		<view class="margin_top border2 ffffff mainpadding">
			<view class="flexleft">
				<image class="shopImg margin_right1" src="/static/images/order/shop.png" mode=""></image>
				<view class="text_x color_ling margin_right1">{{orderInfo.shop_data.name}}</view>
				<u-icon name="arrow-right" color="#999" size="16"></u-icon>
			</view>
			<view class=" margin_top" v-for="item in orderInfo.goods_data" :key="item.id">
				<view class="flexleft">
					<view class="goodsImg margin_right3">
						<image :src="item.logoimage" mode=""></image>
						<view class="shipment" v-show="item.is_sell==1">已出貨</view>
					</view>
					<view class="flex1 justify_between_column" style="height: 157rpx;">
						<view class="text_a color_san bold">{{item.goods_name}}</view>
						<view class="xiaohui flexbetween" v-if="item.wei || item.hei">
							<text>尺寸：{{item.wei}}*{{item.hei}}</text>
							<text>用量：{{item.formulacount}}{{item.size}}</text>
						</view>
						<view class="xiaolan" v-if="item.spunatdata_text && item.spunatdata_text.length">規格：<text class="margin_right1" v-for="(value) in item.spunatdata_text" :key="value.spunatid">{{value.spunatname}}*{{value.num}}</text></view>
						<view class="flexbetween margin_top1">
							<view class="price">${{item.price}}&nbsp;&nbsp;&nbsp;x{{item.num}}</view>
							<view class="text_six color_orange">${{item.price}}</view>
						</view>
					</view>
				</view>
				<template v-if="item.sp_attr_text && item.sp_attr_text.length">
					<view class="flexbetween margin_top1" v-for="(ite,ind) in item.sp_attr_text" :key="ind">
						<view class="xiaohei smalltext">{{ite.name}}</view>
						<view class="xiaohui smalltext">{{ite.value}}</view>
					</view>
				</template>
			</view>
			<view class="flexleft margin_top" v-for="item in orderInfo.cdbjhsf_data_text" :key="item.id" v-if="item.price!=0 && item.num!=0">
				<view class="listleftimg radius margin_right">
					<image class="listleftimg radius" src="@/static/logo.png" mode=""></image>
				</view>
				<view class="justify_between_column" style="height: 157rpx;width: 100%;">
					<view class="hei_text main_size bold">{{item.name}}</view>
					<view class="flexbetween">
						<view class="main_size huang_text bold">${{item.price}}&nbsp;&nbsp;&nbsp;x{{item.num}}
						</view>
						<view class="main_size huang_text bold">${{item.price*item.num}}</view>
					</view>
				</view>
			</view>
		</view>
		<view class="mainpadding_top ffffff radius" v-if="orderInfo.opentype!==-1 && orderInfo.fpinfo!=null"
			@click="gofpDetail(orderInfo.fpinfo)">
			<view class="flexbetween">
				<view class="titletext hei_text bold">發票信息</view>
				<text class="weikai" v-if="orderInfo.fpinfo && orderInfo.fpinfo.is_ly==1">未列印</text>
				<text class="yikai" v-if="orderInfo.fpinfo && orderInfo.fpinfo.is_ly==2">已列印</text>
			</view>
			<view class="flexbetween bold margin_top">
				<view class="flexleft">
					<view class="xiaolan bold main_size lanlable" v-if="orderInfo.opentype==0">紙本</view>
					<view class="xiaolan bold main_size lanlable" v-if="orderInfo.opentype==1">載具</view>
					<view class="xiaolan bold main_size lanlable" v-if="orderInfo.opentype==2">統編</view>
					<view class="xiaolan bold main_size lanlable" v-if="orderInfo.opentype==3">捐贈</view>
					<view v-if="orderInfo.tbcode"
						class="bold xiaolan margin_left1 ershib">{{orderInfo.tbcode}}</view>
				</view>
				<view class="flexright"  v-if="orderInfo.fpinfo && orderInfo.fpinfo.invoice_number">
					<view class="bold main_size margin_right1" :class="orderInfo.fpinfo.status==3?'xiaohong':'xiaolan'">
						發票號碼：{{orderInfo.fpinfo.invoice_number}}</view>
					<view class="xiaohong bold main_size" v-if="orderInfo.fpinfo.status==3">作廢</view>
				</view>
			</view>
			<view class="flexbetween bold margin_top" v-if="orderInfo.opentype==2">
				<view class="xiaolan bold main_size" v-if="orderInfo.tbmc">發票抬頭 </view>
				<view class="xiaolan bold main_size" v-if="orderInfo.tbmc">{{orderInfo.tbmc}}</view>
			</view>
		</view>
		<view class="mainpadding_top ffffff radius"
			v-if="orderInfo.status==7 || (orderInfo.status==8&&(orderInfo.ps_type==1 || orderInfo.ps_type==2)) || orderInfo.status==9">
			<view class="titletext hei_text bold">騎手信息</view>
			<view class="flexbetween margin_top">
				<view class="hei_text main_size">姓名</view>
				<view class="hui_text main_size">{{orderInfo.takeaway.name}}</view>
			</view>
			<view class="flexbetween margin_top">
				<view class="hei_text main_size">手機號</view>
				<view class="flexright">
					<view class="hui_text main_size">{{orderInfo.takeaway.phone}}</view>
					<view class="flexright beihuolable margin_left1 radius" @click="phone(orderInfo.takeaway.phone)">
						<u-icon name="phone" color="#ff8505" size="18"></u-icon>
						<view class="xiaohuang">拨打電話</view>
					</view>
				</view>
			</view>
		</view>
		<!-- 訂單規格 -->
		<view class="margin_top border2 ffffff mainpadding">
			<view class="flexbetween">
				<view class="hei_text main_size bold">訂單合計</view>
				<view class="hui_text main_size bold">${{orderInfo.total_goods_price}}</view>
			</view>
			
			<view class="flexbetween margin_top1">
				<view class="text_a color_ling">配送費</view>
				<view class="text_a color_six">{{orderInfo.freight_price}}</view>
			</view>
			<view class="flexbetween margin_top1">
				<view class="text_a color_ling">服務費</view>
				<view class="text_a color_six">{{orderInfo.fw_price}}</view>
			</view>
			<view class="flexbetween margin_top1 ">
				<view class="text_a color_ling">優惠金額</view>
				<view class="text_a color_six">-${{orderInfo.yh_money}}</view>
			</view>
			<view class="flexbetween margin_top1">
				<view class="text_a color_ling">儲值扣款</view>
				<view class="text_a color_six">-${{orderInfo.shop_user_price}}</view>
			</view>
			<view v-show="orderInfo.paytype!=0">
				<view class="flexbetween margin_top1">
					<view class="hei_text main_size bold">{{returnzftext(orderInfo.paytype)}}</view>
					<view class="huang_text main_size bold">-${{orderInfo.paymoney}}</view>
				</view>
			</view>
			<view class="flexbetween margin_top1 dashedline">
				<view class="text_a color_ling">總金額</view>
				<view class="text_x color_orange">${{orderInfo.countmoney}}</view>
			</view>
			<view class="flexbetween margin_top1">
				<view class="text_a color_ling">已付金額</view>
				<view class="text_a color_six">${{Number(orderInfo.paymoney)+Number(orderInfo.shop_user_price)|| 0}}</view>
			</view>
			<view class="flexbetween margin_top1">
				<view class="text_a color_ling">未付金額</view>
				<view class="text_x color_red">${{orderInfo.zhuimoney}}</view>
			</view>
			<view class="flexbetween margin_top1">
				<view class="text_a color_ling">訂單編號</view>
				<view class="text_a color_six">{{orderInfo.order_sn}}</view>
			</view>
			<view class="flexbetween margin_top1">
				<view class="text_a color_ling">下單時間</view>
				<view class="text_a color_six">{{secondDate(orderInfo.createtime,0,0)}}</view>
			</view>
			<view class="flexbetween margin_top1">
				<view class="text_a color_ling">支付方式</view>
				<view class="text_a color_six" v-if="orderInfo.paytype==0">待支付</view>
				<view class="text_a color_six" v-if="orderInfo.paytype==1">點數支付</view>
				<view class="text_a color_six" v-if="orderInfo.paytype==2">多元支付</view>
				<view class="text_a color_six" v-if="orderInfo.paytype==3">現金支付</view>
				<view class="text_a color_six" v-if="orderInfo.paytype==4">信用卡</view>
				<view class="text_a color_six" v-if="orderInfo.paytype==5">Line Pay線上支付
				</view>
				<view class="text_a color_six" v-if="orderInfo.paytype==6">街口線上支付
				</view>
				<view class="text_a color_six" v-if="orderInfo.paytype==7">街口線下支付
				</view>
				<view class="text_a color_six" v-if="orderInfo.paytype==8">Line Pay線下支付
				</view>
				<view class="text_a color_six" v-show="orderInfo.paytype==9">Line Pay二維碼支付
				</view>
				<view class="text_a color_six" v-show="orderInfo.paytype==10">街口二維碼支付
				</view>
			</view>
			<view class="flexbetween margin_top1" v-if="orderInfo.ordernotes">
				<view class="text_a color_ling">備注</view>
			</view>
			<view class="flexbetween margin_top1 word_wrap" v-if="orderInfo.ordernotes">
				<view class="text_a color_six">{{orderInfo.ordernotes}}</view>
			</view>
			<view class="flexbetween margin_top1"
				v-if="orderInfo.status!=0 && orderInfo.status!=1 && orderInfo.status!=100 && orderInfo.jdtime">
				<view class="hei_text main_size bold">接單時間</view>
				<view class="text_a color_six">{{http.timereturn(orderInfo.jdtime * 1000)}}</view>
			</view>
			<view class="flexbetween margin_top1" v-if="orderInfo.pzqh_image_text">
				<view class="hei_text main_size bold">騎手取貨上傳</view>
				<view class="text_a color_six">{{http.timereturn(orderInfo.qhtime * 1000)}}</view>
			</view>
			<view class="flexleft" v-if="orderInfo.pzqh_image_text">
				<view class="itemimgBox flexcenter margin_top1" v-for="(item,index) in orderInfo.pzqh_image_text"
					:key="index">
					<image class="listleftimg radius" :src="item" mode=""
						@click="lbtpriview(index,orderInfo.pzqh_image_text)"></image>
				</view>
			</view>
			<view class="flexbetween margin_top1" v-if="orderInfo.pzsd_image_text">
				<view class="hei_text main_size bold">騎手送达上傳</view>
				<view class="text_a color_six">{{http.timereturn(orderInfo.endtime * 1000)}}</view>
			</view>
			<view class="flexleft margin_top1" v-if="orderInfo.pzsd_image_text">
				<view class="itemimgBox flexcenter margin_top1" v-for="(item,index) in orderInfo.pzsd_image_text"
					:key="index">
					<image class="listleftimg radius" :src="item" mode=""
						@click="lbtpriview(index,orderInfo.pzsd_image_text)"></image>
				</view>
			</view>
			<view class="flexbetween margin_top1" v-if="orderInfo.paypz_image_text">
				<view class="xiaohei main_size">支付憑證</view>
				<image class="listleftimg1 radius" :src="orderInfo.paypz_image_text" mode=""
					@click.stop="lbtpriview(0,[orderInfo.paypz_image_text])"></image>
			</view>
		</view>
		<template v-if="orderInfo.is_ping">
			<view class="mainpadding border2 ffffff margin_top1"
				v-if="(orderInfo.type==0 && orderInfo.ps_type==1) || (orderInfo.type==0 && orderInfo.ps_type==2)">
				<view class="flexleft">
					<view class="text_x color_ling margin_right1">騎手評價</view>
					<u-rate active-color="#FAB536" inactive-color="#b2b2b2" readonly v-model="pjall.q_pf" :minCount="1"
						size="25"></u-rate>
				</view>
				<view class="text_five margin_top1">{{pjall.q_txt}}</view>
			</view>
			<view class="margin_top1 border2 ffffff mainpadding">
				<view class="flexleft">
					<view class="text_x color_ling margin_right1">店鋪評價</view>
					<u-rate active-color="#FAB536" inactive-color="#b2b2b2" readonly v-model="pjall.shop_pf"
						:minCount="1" size="25"></u-rate>
				</view>
				<view class="text_five margin_top1">{{pjall.shop_txt}}</view>
				<!-- 圖片 -->
				<view class="flexleft flex_wrap">
					<view class="item_image_box margin_top1" v-for="(item,index) in pjall.images_text" :key="index">
						<view class="item_image radius">
							<image :src="item" mode="" @click="lbtpriview(index,pjall.images_text)"></image>
						</view>
					</view>
				</view>
			</view>
		</template>
		<!-- 底部按钮 -->
		<view class="footer flex-wrap flexright">
			<view class="greyBtn" v-if="orderInfo.status==0||orderInfo.status==100" @click="cancelOrder()">取消訂單</view>
			<view class="orangeBtn margin_left1" v-show="orderInfo.status==0" @click.stop="pzshow=true;currentid=id">
				上傳憑證</view>
			<view class="orangeBtn margin_left1" v-if="orderInfo.status==0" @click="oncePay()">立即付款</view>
			<view class="orangeBtn margin_left1" v-show="orderInfo.type==2 && Number(orderInfo.desk)<=0  && orderInfo.status==1"
				@click.stop="xzth(orderInfo.id)">掃二維碼</view>
				<view class="greyBtn margin_left1" v-show="orderInfo.type==2&&orderInfo.desk && orderInfo.desk!=-1" @click.stop="fuwuling(orderInfo)">服務鈴</view>
			<view class="orangeBtn"
				v-if="orderInfo.status==7 || (orderInfo.status==8&&(orderInfo.ps_type==1 || orderInfo.ps_type==2)) || orderInfo.status==9"
				@click="phone(orderInfo.takeaway.phone)">聯係騎手</view>
			<view class="greyBtn" v-show="orderInfo.status==8 && orderInfo.ps_type==0" @click="show=true">查看物流</view>
			<view class="orangeBtn margin_left1"
				v-show="(orderInfo.status==8 && orderInfo.ps_type==0) || orderInfo.status==9" @click="suresh">確認收貨
			</view>
			<view class="greyBtn" v-show="orderInfo.status==88" @click="removeOrder()">刪除訂單</view>
			<!-- <view class="orangeBtn margin_left1" v-show="orderInfo.status==88">查看發票</view> -->
			<view class="orangeBtn margin_left1" v-show="(orderInfo.status==87 || orderInfo.status==88) && Number(orderInfo.zhuimoney) && orderInfo.order_type!=2 && orderInfo.order_type!=3"
				@click.stop="jxPay(orderInfo)">立即付款</view>
				<view class="orangeBtn margin_left1"
					@click.stop="goSelectGoods(orderInfo.shop_id,orderInfo.id)"
					v-show="orderInfo.type==2 && orderInfo.order_type!=2 && orderInfo.order_type!=3 && orderInfo.status!=88">點餐</view>
			<view class="orangeBtn margin_left1" v-show="orderInfo.status==88 && orderInfo.is_ping==0"
				@click.stop="goPublishEvaluate(orderInfo)">去評價</view>
			<!-- <view class="orangeBtn" v-show="orderInfo.status==88">查看評價</view> -->
		</view>
		<!-- 步骤条 -->

		<u-popup :show="show" mode="center" round="24" @close="show=false">
			<view class="popupBox">
				<u-steps current="3" dot direction="column" activeColor="#FFB800">
					<u-steps-item title="訂單提交成功" desc="06-29 15:36"></u-steps-item>
					<u-steps-item title="已出库" desc="06-29 15:36"></u-steps-item>
					<u-steps-item title="运输中" desc="06-29 15:36"></u-steps-item>
					<u-steps-item title="运输中" desc="06-29 15:36"></u-steps-item>
				</u-steps>
			</view>
		</u-popup>
		<u-modal :show="showConfirm" showCancelButton confirmColor="#ffb800" @cancel="showConfirm=false"
			confirmText="確認" cancelText="取消" @confirm="orderConfirm">
			<view class="slot-content color_ling text_weight text">
				{{text}}
			</view>
		</u-modal>
		<!-- 上傳支付憑證 -->
		<u-modal :show="pzshow" title="上傳憑證" confirmColor="#ffb800" confirmText="確認" @confirm="upconfirm"
			cancelText="取消" @cancel="pzshow=false" showCancelButton>
			<view class="slot-content" style="width: 730rpx;">
				<view class="flexcenter">
					<view class="itemimgBox flexcenter margin_top2" v-for="(item,index) in images_text" :key="index">
						<!-- 已上傳 -->
						<view class="listleftimg1 radius">
							<image class="radius" :src="item" mode=""></image>
							<view class="deleteimg" @click="delindex(index,images,images_text)"></view>
						</view>
					</view>
					<view class="itemimgBox flexcenter margin_top2" @click="uploadImg(1,images,images_text)"
						v-if="images.length<1"><!-- 未上傳 -->
						<image class="listleftimg1 radius" src="@/static/images/mine/noImage.png" mode=""></image>
					</view>
				</view>
			</view>
		</u-modal>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				show: false,
				id: "", //訂單id
				orderInfo: {},
				pageShow: false,
				showConfirm: false,
				text: "",
				pjall: {}, //評價信息
				orderType: 0, //0取消訂單 1刪除訂單
				images: [],
				images_text: [],
				currentid: "",
				pzshow: false
			}
		},
		onLoad(options) {
			this.id = options.id

		},
		onShow() {
			this.getInfo()
		},
		methods: {
			gofpDetail(fpInfo) {
				if (fpInfo.id) {
					uni.navigateTo({
						url: "/pages_mine/invoiceDetail?id=" + fpInfo.id
					})
				}
			},
			fuwuling(item) {
				let that = this
				uni.showLoading({
					mask: true,
					title: "請稍後"
				})
				httpRequest.request('/api/ordermake/callService', 'GET', {
					shop_id: item.shop_id,
					desk: item.desk,
					user_id: uni.getStorageSync('user_id')
				}).then(res => {
					uni.hideLoading()
					if(res.code==1){
						httpRequest.toast(res.msg)
					}
				})
			},
			connection() {
				if (this.orderInfo.shop_data.id == uni.getStorageSync('user_id')) {
					httpRequest.toast("自己不能和自己聊天哦！");
					return false
				}
				let that = this
				uni.showLoading({
					mask: true,
					title: "請稍後"
				})
				httpRequest.request('/api/user/addFriends', 'GET', {
					firend_id: this.orderInfo.shop_data.user_id,
					sendtype: 1,
					user_id: uni.getStorageSync('user_id')
				}).then(res => {
					uni.hideLoading()
					let data = {
						firend_id: this.orderInfo.shop_data.user_id,
						friend_name: this.orderInfo.shop_data.name,
						firend_avatar_text: this.imgUrl+this.orderInfo.shop_data.logoimage_text
					}
					uni.navigateTo({
						url: "/pages_message/chat?msg=" + encodeURIComponent(JSON.stringify(data))
					})
				})
			},
			uploadImg(value, upImgs, upImgs_text) { //上傳圖片
				let _this = this;
				let num = Number(value) - upImgs.length;
				if (num <= 0) {
					return false;
				}
				uni.showActionSheet({
					itemList: ['照機', '相簿'],
					success: function(res) {
						// 選擇照機走0
						if (res.tapIndex == 0) {
							httpRequest.chooseImage(num, ['camera']).then(res => {
								for (var i = 0; i < res.length; i++) {
									_this.uploadImageService(res[i], upImgs, upImgs_text)
								}
							}).catch(err => {});
						}
						// 選擇相簿走1
						if (res.tapIndex == 1) {
							httpRequest.chooseImage(num, ['album']).then(res => {
								for (var i = 0; i < res.length; i++) {
									_this.uploadImageService(res[i], upImgs, upImgs_text)
								}
							}).catch(err => {});
						}
					},
					fail: function(res) {}
				});
			},
			xzth(id) {
				uni.navigateTo({
					url: "/pages_order/xuanzezt?id=" + id
				})
			},
			delindex(index, upImg, upImgs_text) {
				upImg.splice(index, 1)
				upImgs_text.splice(index, 1)
			},
			uploadImageService(url, upImg, upImgs_text) {
				let _this = this;
				this.http.uploadFile('/api/common/upload', url).then(res => {
					let image_item = res.fullurl;
					upImg.push(res.url)
					upImgs_text.push(image_item);
				}).catch(err => {});
			},
			upconfirm() {
				if (this.images.length == 0) {
					httpRequest.toast("請上傳圖片")
				}
				this.pzshow = false
				httpRequest.request("/api/ordergoods/updateOrderGoodsData", 'GET', {
					id: this.currentid,
					paypz_image: this.images.join()
				}).then(res => {
					httpRequest.toast(res.msg);
					if (res.code == 1) {
						this.images = []
						this.images_text = []
						this.getInfo()
					}
				}).catch(err => {
					httpRequest.toast(err.msg);
				})
			},
			jxPay(item) { //立即付款
				uni.navigateTo({
					url: "/pages_index/payment?msg=" + encodeURIComponent(JSON.stringify({
						id: item.id,
						paymoney: item.zhuimoney,
						order_type: 1,
						shop_id: item.shop_id,
						call_no:item.call_no
					}))
				})
			},
			goSelectGoods(id, order_id) { //點餐選擇商品
				uni.setStorageSync("reservation_order_id", order_id)
				uni.navigateTo({
					url: "/pages_order/selectGoodsList?id=" + id
				})
			},
			goPublishEvaluate(item) { //發表評價
				let data = {
					type: 1,
					qs_ishow: false,
					id: item.id
				}
				// type 0外送，1自取，2内用
				// 判断他的狀態是否外送并且是否有騎手，有展示騎手評價否则不显示騎手評價
				if ((item.type == 0 && item.ps_type == 1) || (item.type == 0 && item.ps_type == 2)) {
					data.qs_ishow = true
				} else {
					data.qs_ishow = false
				}
				uni.navigateTo({
					url: "/pages_order/publishEvaluate?msg=" + encodeURIComponent(JSON.stringify(data))
				})
			},
			async getInfo() { //訂單詳情
				let _this = this
				let res = await this.http.request('/api/Ordergoods/deailOrdergoods', 'POST', {
					id: this.id,
				})
				if (res.code == 1) {
					if (res.data.is_ping) {
						this.getpjdetail()
					}
					res.data.goods_data.forEach(value => {
						value.logoimage = this.imgUrl + value.logoimage
					})
					if (res.data.pzqh_image) {
						let pzqh_image_text1 = res.data.pzqh_image.split(",")
						let pzqh_image_text = []
						if (pzqh_image_text1.length) {
							pzqh_image_text1.forEach(item => {
								let text = this.imgUrl + item
								pzqh_image_text.push(text)
							})
							this.$set(res.data, "pzqh_image_text", pzqh_image_text)
							console.log(res.data);
						}
					}

					if (res.data.pzsd_image) {
						let pzsd_image_text1 = res.data.pzsd_image.split(",")
						let pzsd_image_text = []
						if (pzsd_image_text1.length) {
							pzsd_image_text1.forEach(item => {
								let text = this.imgUrl + item
								pzsd_image_text.push(text)
							})
							this.$set(res.data, "pzsd_image_text", pzsd_image_text)
						}
					}
					this.orderInfo = res.data
					this.pageShow = true
				} else if (res.code == 0) {
					this.http.toast(res.msg)
				} else {
					this.http.toast('系統處理中，請稍後再試');
				}
			},
			async getpjdetail() {
				let _this = this
				let res = await this.http.request('/api/shop/evaluatedeail', 'POST', {
					id: this.id,
					type: 1
				})
				if (res.code == 1) {
					if (res.data.images) {
						let arr = JSON.parse(JSON.stringify(res.data.images.split(",")))
						let arr2 = []
						arr.forEach(item => {
							arr2.push(this.imgUrl + item)
						})
						this.$set(res.data, "images_text", arr2)
					}
					this.pjall = res.data
				}
			},
			oncePay() { //立即付款
				uni.navigateTo({
					url: "/pages_index/payment?msg=" + encodeURIComponent(JSON.stringify({
						id: this.orderInfo.id,
						paymoney: this.orderInfo.zhuimoney,
						order_type: 0,
						shop_id: this.orderInfo.shop_id,
						call_no: this.orderInfo.call_no

					}))
				})
			},
			cancelOrder() { //取消訂單
				this.text = "您確定要取消此訂單吗？"
				this.orderType = 0
				this.showConfirm = true
			},
			suresh() {
				this.text = "確認收到貨了吗？"
				this.orderType = 2
				this.showConfirm = true
			},
			removeOrder() { //刪除訂單
				this.text = "您確定要刪除此訂單吗？"
				this.orderType = 1
				this.showConfirm = true
			},
			lbtpriview(index, arr) {
				var i = arr; //獲取当前頁面的轮播圖數据
				//uniapp预览轮播圖
				uni.previewImage({
					current: index, //预览圖片的下标
					urls: i //预览圖片的地址，必须要數组形式，如果不是數组形式就转換成數组形式就可以
				})
			},
			async orderConfirm() { //確認 取消訂單/刪除訂單
				let url = "",
					text = "";
				if (this.orderType == 0) {
					url = "/api/Ordergoods/endOrdergoods"
					text = "取消成功"
				} else if (this.orderType == 1) {
					url = "/api/Ordergoods/delOrdergoods"
					text = "刪除成功"
				} else if (this.orderType == 2) {
					url = "/api/ordergoods/endgoods"
					text = "收貨成功"
				}
				let _this = this
				let res = await this.http.request(url, 'POST', {
					id: this.orderInfo.id
				})
				if (res.code == 1) {
					this.http.toast(text)
					this.showConfirm = false
					setTimeout(() => {
						uni.navigateBack(1)
					}, 500)
				} else if (res.code == 0) {
					this.http.toast(res.msg)
				} else {
					this.http.toast('系統處理中，請稍後再試');
				}
			},
			phone(p) {
				uni.makePhoneCall({
					phoneNumber: p.toString()
				}).catch((e) => {
					// console.log(e)  //用catch(e)来捕獲錯误{makePhoneCall:fail cancel}
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	::v-deep.u-transition {
		z-index: 10 !important;
	}

	.listleftimg1 {
		width: 150rpx;
		min-width: 150rpx;
		height: 150rpx;
		position: relative;

		image {
			width: 100%;
			height: 100%;
		}
	}

	.content {
		padding-bottom: 150rpx;
	}

	.shopImg {
		width: 26.62rpx;
		height: 24rpx;
		min-width: 26.62rpx;
	}

	.contactShop {
		width: 132rpx;
		height: 51rpx;
		line-height: 51rpx;
		text-align: center;
		background: rgba(255, 196, 0, 0.1);
		border-radius: 9rpx 9rpx 9rpx 9rpx;
		border: 1rpx solid #FFB800;
		font-size: 22rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #000000;
	}
		
	

	.goodsImg {
		width: 157rpx;
		height: 157rpx;
		position: relative;

		image {
			width: 100%;
			height: 100%;
			border-radius: 14rpx;
		}

		.shipment {
			// width: 71rpx;
			// height: 30rpx;
			// line-height: 30rpx;
			padding: 4rpx;
			box-sizing: border-box;
			text-align: center;
			background: #13C463;
			border-radius: 14rpx 0rpx 14rpx 0rpx;
			font-size: 18rpx;
			font-family: PingFang SC-Medium, PingFang SC;
			font-weight: 500;
			color: #FFFFFF;
			position: absolute;
			left: 0;
			top: 0;
		}
	}

	.price {
		font-size: 30rpx;
		font-family: DIN Next LT Pro-Bold, DIN Next LT Pro;
		font-weight: bold;
		color: #FF5C00;
	}

	.greyBtn {
		padding:10rpx 30rpx;
		text-align: center;
		border: 2rpx solid rgba(102, 102, 102, 1);
		border-radius: 120rpx;
		font-size: 26rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #666666;
	}

	.orangeBtn {
		padding:10rpx 30rpx;
		text-align: center;
		border: 2rpx solid rgba(255, 92, 0, 1);
		border-radius: 120rpx;
		font-size: 26rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #FF5C00;
	}

	.popupBox {
		width: 660rpx;
		padding: 50rpx 50rpx 0;
		box-sizing: border-box;
	}

	::v-deep.u-steps-item__content {
		flex-direction: row;
		justify-content: space-between;
		margin-bottom: 50rpx;
		flex: 1;
	}

	::v-deep.u-text:nth-child(2) {
		justify-content: flex-end !important;
	}

	.textareas {
		width: 100%;
		box-sizing: border-box;
		height: 203rpx;
		padding: 30rpx;
		border-radius: 8rpx;
		border: 2rpx solid #EFEFEF;
	}
</style>